Skip to content

Add Reset filters button to empty search results - #106136

Merged
JS00001 merged 5 commits into
mainfrom
claude-addEmptyStateResetFilters
Nov 10, 2026
Merged

JS00001 merged 5 commits into
mainfrom
claude-addEmptyStateResetFilters

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Add a primary “Reset filters” action to every “Nothing to show” search empty state, including Insights. The empty state and filter bar share the existing reset condition and navigation action so they stay consistent with view defaults. Other onboarding, travel, and celebratory empty states keep their existing actions.

AI Tests

  • Conflict-resolution follow-up: merged current main, retained its extracted Sentry label constants, and moved this PR's unchanged reset label into the extracted module. Preserved the regular primary button and shared reset behavior.
  • Conflict-resolution passed: 64 targeted tests (empty-search UI, reset/filter-bar hooks, button styles, and Sentry label schema), Storybook smoke test, and static review of the resolution. No unresolved Git conflicts or whitespace errors relative to main.
  • Conflict-resolution limitations: typecheck and changed-file lint encountered missing dependencies in unrelated upstream tooling; changed-file spelling reported upstream issues. Full lint and full Jest exceeded 180 seconds (no Jest failures reported before timeout). React Compiler checking could not resolve its base ref; the prettier script is unavailable. Browser/native testing was not run for this constants-only conflict resolution.
  • Button-style follow-up: removed the success variant so Reset filters uses the regular primary/default button, per design feedback. Added rendered-background regression assertions for expense, report, chat, and invoice empty results; reset behavior is unchanged.
  • Button-style follow-up passed: 62 targeted tests across empty-search UI, reset/filter-bar hooks, and button style utilities; full lint; typecheck; Storybook smoke test; staged follow-up review (no violations, full-branch review unavailable without merge-base history).
  • Button-style follow-up limitations: full Jest exceeded 180 seconds with passing suites and no failures reported before timeout. Changed-file lint/spelling were blocked by missing merge-base history. React Compiler check could not resolve its base ref. The requested prettier script does not exist.
  • Button-style follow-up web verification blocked: the supplied session rendered a blank white page with zero accessible nodes; neither button appearance nor interactive reset could be verified. No UI pass is claimed.
  • Explicit reset-flag follow-up: added shouldShowResetFilters to menu empty-state metadata, enabled for Insights, and removed the title-key comparison. Regression tests cover true/false/omitted flags and title independence.
  • Follow-up passed: all 44 tests across empty-search UI and reset/filter-bar hooks, TypeScript checks, full lint, Storybook smoke test, and review of the staged follow-up (no violations).
  • Follow-up incomplete: full Jest timed out after 180 seconds with 16 passing suites and no failures reported. Changed-file lint/spelling and full-branch review were blocked by missing merge-base history; deepening the checkout timed out. React Compiler checks timed out. The prettier script is absent and targeted formatter execution was denied. Initial broad checks also timed out before narrower retries passed as listed above.
  • Follow-up web verification blocked: the supplied session rendered a blank page with zero accessible nodes, so neither Insights reset nor unfiltered/onboarding behavior could be verified. This is not a verified UI pass.
  • Check-failure follow-up: applied npm run fmt to the empty-search UI test; a second formatter run produced no unstaged diff.
  • Follow-up passed: 41 tests across the empty-search UI and both reset/filter-bar hook suites; full lint; TypeScript checks; Storybook smoke test; staged code review (no violations).
  • Follow-up incomplete: full Jest run exceeded 180 seconds with no failures reported before timeout. Changed-file lint could not find a merge base in the shallow checkout; deepening the fetch and changed-file spelling timed out. Full lint passed independently. The prettier script does not exist; fmt is the repository's formatter.
  • Bun CI failure is unrelated: the isolated transformer hoisting fixture exceeded its 5000 ms timeout (5681 ms); it does not load this PR's Search changes. A local Bun rerun was blocked by execution policy; no unrelated tooling changes were made.
  • Passed: 41 tests across the empty-search UI, shared reset hook, and existing filter-bar hook suites.
  • Passed: TypeScript checks, changed-file lint, spelling, and Storybook smoke test.
  • Passed: staged code review after switching the new action to a composed button component.
  • Incomplete: full lint exceeded 240 seconds; full Jest run exceeded 180 seconds after 32 passing suites with no failures reported before timeout.
  • Blocked: React Compiler check could not resolve origin/ because the workflow base ref is empty; the attempted base-ref override was denied by the execution policy.
  • Unavailable: the requested prettier npm script does not exist in this checkout; a targeted formatter invocation was denied by the execution policy.
  • Web verification blocked: the handed-off authenticated browser session rendered a blank page with zero accessible nodes at both wide and narrow widths. None of the five interactive assertions could be completed; offline simulation is unavailable in the supported tester interface. This is not a verified UI pass.

Fixed Issues

$ #106053
PROPOSAL:

Tests

  1. Go to Spend > Expenses
  2. Add a filter that matches nothing (e.g. Merchant contains zzzz)
  3. Verify the "Nothing to show" empty state shows a grey "Reset filters" button using the regular primary/default style, not the green success style
  4. Verify the filter bar also shows "Reset"
  5. Tap "Reset filters" in the empty state
  6. Verify filters return to defaults, expenses are shown, and both reset buttons disappear
  • Verify that no errors appear in the JS console

Offline tests

N/A. Applying filters offline shows the offline screen.

QA Steps

Same as Tests steps.

  • Verify that no errors appear in the JS console

PR Author Checklist

Checklist boxes checked on behalf of ahmedGaber93 at their request; this is not additional AI test verification. Existing AI test limitations remain recorded above and in the verification comments.

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Web: button-style follow-up (blocked)

The supplied session rendered a blank page. This is blocker evidence, not proof of the feature passing.

Blank white application page in the supplied session
Web: explicit reset-flag follow-up (blocked)

The supplied session rendered a blank page; this is blocker evidence, not proof of the feature passing.

Blank application page in the supplied session
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

AI verification evidence only — both viewports were blocked by a blank page, not successful feature verification.

Blank application at wide viewport Blank application at narrow viewport

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team November 5, 2026 18:24
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Nov 5, 2026
@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/CONST/SENTRY_LABEL.ts 100.00% <ø> (ø)
...ts/Search/SearchPageHeader/useSearchFiltersBar.tsx 33.91% <100.00%> (-2.76%) ⬇️
...s/Search/SearchPageHeader/useSearchFiltersReset.ts 100.00% <100.00%> (ø)
src/libs/SearchSuggestionUtils.ts 94.93% <ø> (ø)
src/libs/SearchUIUtils.ts 76.50% <ø> (ø)
src/pages/Search/SearchResetFiltersButton.tsx 100.00% <100.00%> (ø)
src/pages/Search/EmptySearchView.tsx 91.05% <80.00%> (+6.97%) ⬆️
... and 11 files with indirect coverage changes

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Pushed c4b1882 to fix the Oxfmt check: reformatted EmptySearchViewTest.tsx, with no behavior changes.

  • Passed locally: formatter recheck, full lint, typecheck, 41 targeted tests, Storybook smoke test, and code review.
  • Incomplete: full Jest run timed out after 180 seconds with no failures reported. Changed-file checks were blocked by shallow Git history/fetch timeouts; details are recorded under AI Tests.
  • Unrelated Bun failure: the tooling hoisting test exceeded its 5-second timeout. It transforms an inline fixture without loading this PR’s Search changes, so I left it unchanged. Local reproduction was blocked by execution policy.

New CI checks are pending. The independent-approval requirement still needs human review.


view run

@MelvinBot

MelvinBot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

Verified on dev NewDot web; Expenses empty/reset behavior passes after creating ordinary test data. The tester reached its step limit; narrow layout, offline reset, and console inspection remain unverified.

Reports opens without the merchant filter and has no reports

Step Status
1. Unmatched merchant in ExpensesMerchant Contains zzzz produced Nothing to show, green Reset filters, and filter-bar Reset.
Wide Expenses empty state with unmatched merchant and both reset controls
✅
2. Reset restores defaults and resultsClicking Reset filters restored the created QA Coffee $12.34 expense, removed the merchant filter, and hid both reset buttons.
Expense restored after resetting filters
✅
3. Sticky filter switching to ReportsAfter reapplying zzzz in Expenses, switching to Reports dropped the merchant filter and showed No reports yet. The sticky-filter prerequisite was not met, so Reports empty/reset behavior could not be exercised as documented. PR causation is not established.
Reports opens without the merchant filter and has no reports
⚠️
4. Unfiltered empty view has no reset buttonsSeparate absence assertions passed for Reset filters and filter-bar Reset on unfiltered empty Reports.
Unfiltered empty Reports without either reset button
✅
5. Wide/narrow layouts and offline resetWide 1920×1080 Expenses empty/reset states passed. Narrow layout was not exercised before the step limit. Offline reset was unavailable through supported browser controls; native was out of scope.
Verified wide-layout empty state
Verified wide-layout reset result
⚠️
6. JavaScript console errorsConsole inspection was unavailable through the supported testing interface. No claim of an error-free console is made.
⚠️

view run · no recording available

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Please update

Tests

  1. Go to Spend > Expenses
  2. Add a filter that matches nothing (e.g. Merchant contains zzzz)
  3. Verify the "Nothing to show" empty state shows a green "Reset filters" button
  4. Verify the filter bar also shows "Reset"
  5. Tap "Reset filters" in the empty state
  6. Verify filters return to defaults, expenses are shown, and both reset buttons disappear

Offline tests

N/A. apply filters offline showing offline screen.

QA Steps

Same as Tests step

PR Author Checklist

Mark all author checklist checked

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Mark this PR ready for review

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Updated the PR description with your six Tests steps, offline note, and “Same as Tests steps” for QA. Checked all PR Author Checklist boxes on your behalf, with a note distinguishing this from AI verification. No tests were rerun.


view run

@MelvinBot
MelvinBot marked this pull request as ready for review November 5, 2026 20:14
@MelvinBot
MelvinBot requested a review from a team as a code owner November 5, 2026 20:14
@melvin-bot
melvin-bot Bot requested review from ahmedGaber93 and removed request for a team November 5, 2026 20:14
@melvin-bot

melvin-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

@ahmedGaber93 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Marked Add Reset filters button to empty search results ready for review.


view run

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T20:19:41.448075Z c4b1882 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@melvin-bot
melvin-bot Bot requested review from twisterdotcom and removed request for a team November 5, 2026 20:14
Comment thread src/pages/Search/EmptySearchView.tsx Outdated
...button,
buttonText: translate(button.buttonText),
})),
children: menuItem.emptyState.title === 'search.searchResults.emptyResults.title' ? <SearchResetFiltersButton /> : undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ CONSISTENCY-18 (docs)

This branch injects the reset button only when the menu item's emptyState.title happens to equal the generic empty-results translation key. Why the reset action is gated on the title key matching that exact value is not recoverable from the code, so the next contributor has to reverse-engineer the intent (and will not know this breaks silently if another emptyState later reuses that title).

Add a short comment stating the reason, e.g.:

// Only the generic "no results" empty state (identified by its shared title key) represents a filtered
// search that can be reset, so that is the only menu-provided state that gets the reset button.
children: menuItem.emptyState.title === 'search.searchResults.emptyResults.title' ? <SearchResetFiltersButton /> : undefined,

Reviewed at: c4b1882 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

Comment thread src/pages/Search/EmptySearchView.tsx Outdated
...button,
buttonText: translate(button.buttonText),
})),
children: menuItem.emptyState.title === 'search.searchResults.emptyResults.title' ? <SearchResetFiltersButton /> : undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ CONSISTENCY-2 (docs)

The translation key 'search.searchResults.emptyResults.title' is hardcoded here as a discriminator and is also repeated in getEmptyResultsContent on line 215. A bare literal used as a comparison value is easy to desync: if the key is ever renamed, this condition silently stops matching and the reset button disappears with no error.

Extract the key to a shared named constant (or compare against the same identifier getEmptyResultsContent builds from) so there is a single source of truth, e.g.:

const EMPTY_RESULTS_TITLE_KEY = 'search.searchResults.emptyResults.title';
// ...
children: menuItem.emptyState.title === EMPTY_RESULTS_TITLE_KEY ? <SearchResetFiltersButton /> : undefined,

Reviewed at: c4b1882 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MelvinBot add an explicit flag (e.g. shouldShowResetFilters) to the menu item’s emptyState definition, set only where it applies (Insights, etc.), and check that flag instead of the title.

@MelvinBot MelvinBot Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Web test steps verification results: ❌ fail

Pushed 1140010: added optional shouldShowResetFilters metadata, enabled it for Insights, and replaced the title comparison; 44 regression/hook tests, typecheck, full lint, Storybook smoke test, and staged follow-up review passed. Web verification was blocked by a blank page with zero accessible nodes; full Jest and compiler checks timed out, changed-file checks lacked Git history, and formatter checks were unavailable/denied (details recorded under AI Tests).

Blank application page in the supplied session

Step Status
Filtered empty Insights shows Reset filters and restores defaultsBlocked prerequisite: Insights was inaccessible because no application UI rendered. This is not evidence of a feature regression.
Blank application page in the supplied session
❌
Unfiltered empty/onboarding view retains existing actions without Reset filtersBlocked prerequisite: no empty-view or onboarding UI was available. A blank page does not establish the expected absence of Reset filters.
❌

view run · no recording available

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner November 5, 2026 21:35
@melvin-bot
melvin-bot Bot requested review from JS00001 and removed request for a team November 5, 2026 21:35
@melvin-bot

melvin-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

@JS00001 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🚧 dubielzyk-expensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

Testing well to me 👍

@ahmedGaber93
ahmedGaber93 requested a review from JS00001 November 10, 2026 11:22
@JS00001

JS00001 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@ahmedGaber93 conflicts

JS00001
JS00001 previously approved these changes Nov 10, 2026
@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot please fix the confilct.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Resolved the conflict and pushed 224b94f. GitHub now reports no merge conflicts.

64 targeted tests and Storybook passed. Broader check limitations are documented under AI Tests.


view run

@melvin-bot
melvin-bot Bot requested a review from JS00001 November 10, 2026 14:38
@JS00001
JS00001 merged commit f035ca4 into main Nov 10, 2026
47 of 49 checks passed
@JS00001
JS00001 deleted the claude-addEmptyStateResetFilters branch November 10, 2026 16:07
@github-actions

Copy link
Copy Markdown
Contributor

🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

Copy link
Copy Markdown
Contributor

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.36-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update needed — this adds a shortcut to the existing filter-reset action without introducing a new workflow or making any existing article inaccurate.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No FullStory changes needed. The new Reset filters button already supplies the stable identifier Search-EmptyState-ResetFilters using the documented FullStory convention, and the remaining changes introduce no new screens, user properties, sensitive content, or outcomes requiring additional instrumentation.


view run

@mitarachim

Copy link
Copy Markdown

Deploy Blocker issue #106588 is repro on all PRs. Could you please double check if it's not introduced by #106136

@mitarachim

Copy link
Copy Markdown

@MelvinBot Could you please confirm whether the Reset Filter button should be green, as shown in the initial step, or grey, as mentioned in this comment?

cc : @ahmedGaber93 @dubielzyk-expensify

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Grey—the regular primary/default button, not green success. This follows the explicit design clarification, and the updated appearance was subsequently approved.

The initial test step mentioning “green” is outdated.


view run

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Please update the test steps to include this #106136 (comment)

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Updated test step 3 to expect a grey “Reset filters” button using the regular primary/default style, not green success. QA inherits this through “Same as Tests steps.”


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants